package com.yfbao.horizon.demo;

import cn.hutool.json.JSON;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Lists;
import com.yfbao.horizon.cache.compress.LZ4Compress;
import com.yfbao.horizon.cache.vo.CacheVo;
import com.yfbao.horizon.model.CacheKeyVo;
import com.yfbao.horizon.model.People;
import com.yfbao.horizon.utils.ComUtils;
import com.yfbao.horizon.utils.PassWordCheck;
import org.springframework.data.redis.core.ZSetOperations;

import java.lang.reflect.Field;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

public class MethodTest {

    public static void main(String[] args) {
//        test1();
//        List<Long> aaaa = (List<Long>) null;
//        test2();
//        SecureRandom secureRandom = new SecureRandom();
//        System.out.println(secureRandom.nextLong());
//        tt();
//        System.out.println(Boolean.valueOf("true")+ String.valueOf(i++));
//        System.out.println(Boolean.valueOf("true").equals(false));
//        testList();
//        mapToString();
//        check();
//        listCopy();
//        testExp();
//        testDeduplication();
//        testKey();
//        sortText();
//        perfTest();
//        testListLength();
//        getFileValue();
//        testNor();
//        testMM();
//        testSort();
//        testStream();
//        testStreamSort();
//        testTree();
//        testStringAppend();
//        testSetToArray();
//        sortKey();
//        testRand();
//        System.out.println(System.currentTimeMillis());
//        mdTest2();
        testTenant();
    }

    private static void testTenant(){
        Long tenant = -999L;
        String name ="name";
        ComUtils.tenantOperation2(tenant,()->{
            System.out.println(name+" do some thing...");
            return null;
        });
        System.out.println("aaaaaaaa");
        int i = ComUtils.tenantOperation(tenant,()->{
            System.out.println(name+" do2 some thing...");
            return 1;
        });
        System.out.println("return:"+i);
    }

    private static void mdTest2(){
        String aa ="{\"title\":\"router.dashboard\",\"icon\":\"vi-ant-design:dashboard-filled\",\"alwaysShow\":true}";
        JSON parse = JSONUtil.parse(aa);
        System.out.println(parse.toString());
    }


//    //验证str是否包含特殊符号
//    private static boolean check(String str){
//        String regEx="[^a-zA-Z0-9]";
//        Pattern p = Pattern.compile(regEx);
//        Matcher m = p.matcher(str);
//        return m.find();
//    }


    private static void mdTest(){
        String body="{\"data\":{\"quantity\":1,\"weight\":300,\"productCode\":\"T4PLPSTDT1430\",\"projectCode\":\"T4PL\",\"incoterm\":\"DDP\",\"hasBattery\":0,\"platformOrderId\":\"S5860202409193458732\",\"customer\":\"TW100015\",\"remark\":\"\",\"sender\":{\"name\":\"FULFILLMENT CENTER\",\"phone\":\"000019294364790\",\"postcode\":\"91748\",\"countryCode\":\"CN\",\"province\":\"CA\",\"city\":\"City of Industry\",\"address\":\"730 Epperson Dr dock 1-7\"},\"receiver\":{\"name\":\"test\",\"phone\":\"12345678912\",\"postcode\":\"46235\",\"countryCode\":\"US\",\"province\":\"IN\",\"city\":\"Indianapolis\",\"address1\":\"9202 E 33RD ST,INDIANAPOLIS,IN\",\"address2\":\"\"},\"parcels\":[{\"descriptionEn\":\"\",\"descriptionLocal\":\"\",\"quantity\":1,\"hasBattery\":0,\"declareValue\":\"0.00\",\"currency\":\"\",\"weight\":300}]},\"messageId\":589679,\"timestamp\":1726735838208.604}";
        String input="/openapi/v2/order/create"+"|"+body+"|"+"76321f83-6972-4452-83c1-194e17a37932"+"|"+"b38aac72-b075-43af-b649-3499b0736a02";
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            byte[] messageDigest = md.digest(input.getBytes());
            StringBuilder hexString = new StringBuilder();
            for (byte b : messageDigest) {
                hexString.append(String.format("%02x", b));
            }
            System.out.println(hexString.toString());
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
            return ;
        }
    }

    public static void testRand(){
        Random random = new Random();
        for(int i=0;i<50;i++){
            System.out.println(random.nextInt(500));
        }

    }

    public static void sortKey(){
        List<String> list =new ArrayList<>();
        long start = System.currentTimeMillis();
        Set<ZSetOperations.TypedTuple<String>> tuples = new HashSet<>();
        for(int i=0;i<10000;i++){
            list.add("aa"+":"+System.currentTimeMillis());
            tuples.add(ZSetOperations.TypedTuple.of("a"+i,Double.valueOf(i)));
//            try {
//                Thread.sleep(10);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
        }
//        List<String> collect = list.stream().sorted(Comparator.comparingLong(key -> Long.valueOf(key.substring(key.lastIndexOf(":") + 1)))).collect(Collectors.toList());
//        for(int j=0;j<100;j++){
//            System.out.println(collect.get(j));
//        }

        List<ZSetOperations.TypedTuple<String>> collect1 = tuples.stream().sorted(Comparator.comparingDouble(key -> ((ZSetOperations.TypedTuple)key).getScore()).reversed()).collect(Collectors.toList());
        if(collect1.size()>500){
            collect1 = collect1.subList(0,500);
            System.out.println("size:"+collect1.size());
        }
        for(int j=0;j<100;j++){
            System.out.println(collect1.get(j).getValue()+","+collect1.get(j).getScore());
        }
        System.out.println("cost:"+(System.currentTimeMillis()-start));
    }

    public static void testSetToArray(){
        Long bb=null;
        System.out.println("aaa:"+bb);
//        String aa = "MIIFxgYKKoEcz1UGAQQCAqCCBbYwggWyAgEBMQ4wDAYIKoEcz1UBgxEFADAwBgoqgRzPVQYBBAIBoCIEIGYxMGUwNjAzYmVjNDQ1Mjg4OWQ4YzRlYzA2M2U0ODU1oIIEhzCCBIMwggQnoAMCAQICCD31AM0AMz2KMAwGCCqBHM9VAYN1BQAwaTELMAkGA1UEBhMCQ04xPDA6BgNVBAoMM05hdGlvbmFsIEUtR292ZXJubWVudCBOZXR3b3JrIEFkbWluaXN0cmF0aW9uIENlbnRlcjEcMBoGA1UEAwwTQ0VHTiBTTTIgQ2xhc3MgMiBDQTAeFw0yNDAzMDMxNjAwMDBaFw0yODAzMDIxNjAwMDBaMIGpMQswCQYDVQQGEwJDTjEeMBwGA1UECAwV5bm/6KW/5aOu5peP6Ieq5rK75Yy6MScwJQYDVQQKDB7oh6rmsrvljLrkvY/miL/ln47kuaHlu7rorr7ljoUxMzAxBgNVBAsMKuiHquayu+WMuuS9j+aIv+WSjOWfjuS5oeW7uuiuvuS/oeaBr+S4reW/gzEcMBoGA1UEAwwT57uf5LiA5pSv5pKR5bmz5Y+wMjBZMBMGByqGSM49AgEGCCqBHM9VAYItA0IABOQwT3R2CG3AfmjkJBldBSJ8UVKi4z/a9++EPCXM1oLT2ARvnyWy8ud9unsXJ1jSYGTxwWK5m8t1mOB3wVAQzGujggJ0MIICcDAMBgNVHRMEBTADAQEAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAOBgNVHQ8BAf8EBAMCAMAwEQYJYIZIAYb4QgEBBAQDAgCAMFQGA1UdIARNMEswSQYIKwYBBQUHAgEwPTA7BggrBgEFBQcCARYvaHR0cDovL3d3dy5zdGF0ZWNhLmdvdi5jbi9Db2x1bW4vQ29sdW1uXzI0OC5odG0wHwYDVR0jBBgwFoAUucCMM4GesPqheyNyP0OU7qnWfn0wgcUGA1UdHwSBvTCBujCBt6CBtKCBsYaBrmxkYXA6Ly9sZGFwLnN0YXRlY2EuY2Vnbi5jbjozODkvQ049Q0VHTiBTTTIgQ2xhc3MgMiBDQSxDTj1DRUdOIFNNMiBDbGFzcyAyIENBLCBPVT1DUkxEaXN0cmlidXRlUG9pbnRzLCBvPXNpY2NhP2NlcnRpZmljYXRlUmV2b2NhdGlvbkxpc3Q/YmFzZT9vYmplY3RjbGFzcz1jUkxEaXN0cmlidXRpb25Qb2ludDCBvwYIKwYBBQUHAQEEgbIwga8wgawGCCsGAQUFBzAChoGfbGRhcDovL2xkYXAuc3RhdGVjYS5jZWduLmNuOjM4OS9DTj1DRUdOIFNNMiBDbGFzcyAyIENBLENOPUNFR04gU00yIENsYXNzIDIgQ0EsIE9VPWNBQ2VydGlmaWNhdGVzLCBvPXNpY2NhP2NBQ2VydGlmaWNhdGU/YmFzZT9vYmplY3RDbGFzcz1jZXJ0aWZpY2F0aW9uQXV0aG9yaXR5MB0GA1UdDgQWBBTyFxMvqFjX7EQXVnxRwgElsZKBijAMBggqgRzPVQGDdQUAA0gAMEUCIFDcWS6i87WtP8N7bSqMy+gIBUNvLJswT+3HwQQxOmzjAiEA3+Bm3GrkFkiBsO3p1W6sLp3Pq73eC1IZoiWDbRmV9Ewxgd8wgdwCAQEwdTBpMQswCQYDVQQGEwJDTjE8MDoGA1UECgwzTmF0aW9uYWwgRS1Hb3Zlcm5tZW50IE5ldHdvcmsgQWRtaW5pc3RyYXRpb24gQ2VudGVyMRwwGgYDVQQDDBNDRUdOIFNNMiBDbGFzcyAyIENBAgg99QDNADM9ijAKBggqgRzPVQGDETAKBggqgRzPVQGCLQRIMEYCIQDk0k1mXSAyoOUftkI3A6D08LJK/glMJPQToClL+0lw0wIhANOjkTNNpHF2f6/GqKeMdY8U9BLjHCph1p2gDVTdGKwN";
////        String aa ="ZjEwZTA2MDNiZWM0NDUyODg5ZDhjNGVjMDYzZTQ4NTU=";
//        Base64.Encoder encoder = Base64.getEncoder();
//        String s = encoder.encodeToString(aa.getBytes());
//        System.out.println(s);
//        String s1 = new String(Base64.getDecoder().decode(s));
//        System.out.println(s1.equals(aa));

//        Boolean aa =null;
//        System.out.println(Boolean.compare(aa,false));
//        System.out.println(Boolean.compare(true,false));
//        Set<String> aaa =new HashSet<>();
//        aaa.add("a");
//        aaa.add("b");
//        aaa.add("c");
//        Set<String> bbb =new HashSet<>();
//        bbb.addAll(aaa);
//        bbb.remove("c");
//        System.out.println(aaa);
//        System.out.println(bbb);
//        Set<String> mySet = new HashSet<String>();
//        mySet.add("Apple");
//        mySet.add("Banana");
//        mySet.add("Cherry");
//
//// 使用toArray()方法将Set转换为Object数组
//        Object[] array = mySet.toArray();
//// 如果需要特定类型的数组，可以使用ArgumentException形式的toArray(T[] a)
//        String[] stringArray = mySet.toArray(new String[0]);
//        System.out.println(stringArray);
    }

    public static void testStringAppend(){
        System.out.println("begin");
        Set<String> set =new HashSet<>();
        long start = System.currentTimeMillis();

        for(int i=0;i<5000;i++){
            String aa="123123123123123"+"_"+"1"+"_"+"Dadraraasdas"+"_"+"12312312312312";
            set.add(aa);
        }
        System.out.println("cost:"+(System.currentTimeMillis()-start));
        Set<String> set2 =new HashSet<>();
        long start2 = System.currentTimeMillis();
        for(int i=0;i<5000;i++){
            StringBuilder aa=new StringBuilder();
            aa.append("123123123123123").append("_").append("1").append("_").append("Dadraraasdas").append("_").append("12312312312312");
            set2.add(aa.toString());
        }
        System.out.println("cost2:"+(System.currentTimeMillis()-start2));
    }

    public static void testTree(){
//        Comparator<Integer> lengthComparator = new Comparator<Integer>() {
//            @Override
//            public int compare(Integer x, Integer y) {
//                return (x < y) ? -1 : ((x.equals(y)) ? 0 : 1);
//            }
//        };
//            TreeMap<Integer, Integer> treeMap = new TreeMap<>(lengthComparator);
//            treeMap.put(3, 3);
//            treeMap.put(1, 2);
//            treeMap.put(2, 1);
//            treeMap.put(2, treeMap.get(2)+3);
//        treeMap.put(1, treeMap.get(1)+5);
//
//            // 按键排序顺序遍历
//        for (Map.Entry<Integer, Integer> entry : treeMap.entrySet()) {
//            System.out.println(entry.getKey() + ": " + entry.getValue());
//        }
        Map<Long,Integer> map =new HashMap<>();
        map.put(3L, 3);
        map.put(1L, 2);
        map.put(2L, 1);

    }

    public static void testStreamSort() {
        Set<String> set =new HashSet<>();
        set.add("-");
        System.out.println(set.iterator().next());
        // 创建一个包含多个Map的List
        List<Map<String, Object>> listMap = new ArrayList<>();
        Map<String, Object> map1 = new HashMap<>();
        map1.put("name", "Alice");
        map1.put("age", 30);
        listMap.add(map1);

        Map<String, Object> map2 = new HashMap<>();
        map2.put("name", "Bob");
        map2.put("age", 25);
        listMap.add(map2);

        Map<String, Object> map3 = new HashMap<>();
        map3.put("name", "Charlie");
        map3.put("age", 35);
        listMap.add(map3);

        // 使用Stream API根据age排序
        List<Map<String, Object>> sortedList = listMap.stream()
                .sorted(Comparator.comparing(map -> Integer.valueOf((map.get("age")).toString())))
                .collect(Collectors.toList());

        // 输出排序结果
        sortedList.forEach(map -> {
            System.out.println("Name: " + map.get("name") + ", Age: " + map.get("age"));
        });
        int maxLoadNum = 2;
        for(int i=sortedList.size()-1;i>=0;i--){
            maxLoadNum--;
            if(maxLoadNum<0){
                return;
            }
            maxLoadNum--;
            Map<String, Object> map = sortedList.get(i);
            System.out.println("Name: " + map.get("name") + ", Age: " + map.get("age"));
        }
    }

    private static void testStream(){
//        String aa ="1231231";
//        String[] split = aa.split(",");
//        System.out.println(split);


        List<CacheKeyVo> list = new ArrayList<>();
        Random random =new Random();
        for(int i=0;i<100;i++){
            CacheKeyVo vo =new CacheKeyVo();
            vo.setTenantId(i%10L);
            vo.setValue(random.nextInt(100));
            list.add(vo);
        }

        Map<Long, Set<Integer>> collect = list.stream().collect(Collectors.groupingBy(
                CacheKeyVo::getTenantId, // Key Mapper
                Collectors.mapping(CacheKeyVo::getValue, Collectors.toSet())));
        System.out.println(collect);
        Map<Long,Set<Integer>> map1 = list.stream().collect(Collectors.toMap(CacheKeyVo::getTenantId,each->Collections.singleton(each.getValue()),(value1, value2) -> {
            Set<Integer> union = new HashSet<>(value1);
            union.addAll(value2);
            return union;
        }));
        System.out.println(map1);

//        Map<Long,List<Double>> map = list.stream().collect(Collectors.toMap(CacheKeyVo::getTenantId,each->Collections.singletonList(each.getScore()),(value1, value2) -> {
//            List<Double> union = new ArrayList<>(value1);
//            union.addAll(value2);
//            return union;
//        }));
//        System.out.println(map);
    }

    private static void testSort(){
        List<CacheKeyVo> list = new ArrayList<>();
        Random random =new Random();
        for(int i=0;i<10;i++){
            CacheKeyVo vo =new CacheKeyVo();
            vo.setScore(Double.valueOf(random.nextInt(100)));
            list.add(vo);
        }
        System.out.println(list);
        List<CacheKeyVo> collect = list.stream().sorted(Comparator.comparing(CacheKeyVo::getScore)).collect(Collectors.toList());
        System.out.println(collect);
    }

    private static void testMM(){
        String key1= "asa:1123123:1212121:nihao::123_11231*";
        String key2= "asa:1212121:nihao::123_**";
        String key3= "asa:1212121:hhehe:nihao::123_**";
        List<String> list =new ArrayList<>();
        list.add(key1);
        list.add(key2);
        list.add(key3);

        for (String key : list) {
            String[] split = key.split("::");
            if(split.length<=1){
                continue;
            }
            String s = split[0];
            String[] split1 = s.split(":");
            String s1 = split1[split1.length - 1];
            System.out.println(s1);
        }
    }


    private static void testNor(){
        Boolean aaa =null;
        if(aaa !=null && true == aaa){
            System.out.println("true");
            return;
        }
        System.out.println("false");
    }

    private static void getFileValue(){
        System.out.println("_loginSet_isUnify_" + false);
        List<CacheKeyVo> list = new ArrayList<>();
        for(int i =0;i<10;i++){
            CacheKeyVo vo =new CacheKeyVo();
            vo.setCacheKey(i+"0000");
            vo.setTenantId(i+ 111231231231L);
            list.add(vo);
        }
        String meta = "cacheKey";
        try {
            for (CacheKeyVo vo : list) {
                Class<? extends CacheKeyVo> aClass = vo.getClass();
                Field field = aClass.getDeclaredField(meta);
                field.setAccessible(true);
                Object obj = field.get(vo);
                if (obj != null && ((String) obj).contains("000")) {
                    System.out.println(vo);
                }
            }
        }catch (Throwable t){
            System.out.println("error");
        }
    }

    private static void testListLength(){
        List<Long> list = new ArrayList<>();
        Random random =new Random();
        for(int i=0;i<10;i++){
            long aLong = random.nextLong();
            list.add(aLong);
        }
        String s = JSONUtil.toJsonStr(list);
        System.out.println("length:"+s.length());
        System.out.println(s);
        JSONArray objects = JSONUtil.parseArray(s);
        System.out.println(objects);

//        CacheVo cacheVo = LZ4Compress.compressObject(list);

    }

    private static void perfTest(){

        long cc = System.currentTimeMillis();
        Set<Long> set =new HashSet<>();
        for(int i=0;i<10000;i++){
            Long tt = i%1000L;
            set.add(tt);
        }
        boolean bb =false;
        if(set.contains(0L)
                ||set.contains(-1L)
                || set.contains(1L)){
            bb=true;
        }
        System.out.println("bb:"+bb+",cost:"+(System.currentTimeMillis()-cc));
        boolean aaa =false;
        long currentTimeMillis = System.currentTimeMillis();
        for(int i=0;i<10000;i++){
            Long tt = i%1000L;
            if(tt.equals(0L)
                    ||tt.equals(-1L)
                    || tt.equals(1L)){
                aaa=true;
            }
        }
        System.out.println("aa:"+aaa+",cost:"+(System.currentTimeMillis()-currentTimeMillis));
    }

    private static void sortText(){
        Random random =new Random();
        List<CacheKeyVo> cacheVoList =new ArrayList<>();
        for(int i=0;i<20;i++){
            CacheKeyVo cacheVo = new CacheKeyVo();
            cacheVo.setTenantId(-1L);
            cacheVo.setCacheKey(String.valueOf(i));
            cacheVo.setScore(Double.valueOf(random.nextInt(100)));
            cacheVoList.add(cacheVo);
        }
        System.out.println(cacheVoList);
        Collections.sort(cacheVoList, new Comparator<CacheKeyVo>() {
            @Override
            public int compare(CacheKeyVo o1, CacheKeyVo o2) {
                return (int)o2.getScore().doubleValue() -(int)o1.getScore().doubleValue();
            }
        });
        System.out.println(cacheVoList);

    }

    private static void testKey(){
        String strkey=null;
        Long aa =null;

        Boolean bb =null;
        String key = strkey+"_"+aa+"_"+bb;
        System.out.println(key);
    }

    private static void testExp(){
        String password ="Bbyf1qq12\"31231";
        System.out.println(Pattern.matches(".*[a-z].*",password));
        System.out.println(Pattern.matches(".*[A-Z].*",password));
        System.out.println(Pattern.matches(".*\\d.*",password));
        System.out.println(Pattern.matches(".*[~`!@#$%^&*()_+\\-=\\[\\]{}|\\\\;:'\",.<>?/].*",password));
//        if(!Pattern.matches(".*[~`!@#$%^&*()_+-=\\[\\]{}|\\\\;:'\",.<>?/].*",password)){
//            System.out.println("xxxxx");
//            return;
//        }
//        System.out.println("bbbbbb");
//        return;
    }

    private static void listCopy(){
        List<People> list =new ArrayList<>();
        for(int i=0;i<10;i++){
            People people = new People("name:"+i);
            list.add(people);
        }

        List<People> list2 =new ArrayList<>();
        list2.addAll(list);
        list2.get(0).setName("aaaa");
        for (People people : list2) {
            System.out.println(people.getName());
        }
        System.out.println("----------------------------");
        for (People people : list) {
            System.out.println(people.getName());
        }

    }

    private static void check(){
        // ~`!@#$%^&*()_+-=[]{}\|:;'",.<>?/
        String password="asda13242";
        boolean b = PassWordCheck.checkPasswordStrengthForCustom(password, 8, true, true, true);
        String part ="~`!@#$%^&*()_+-=[]{}\\|:;'\",.<>?/";
        for(int i=0;i<part.length();i++){
            String substring = part.substring(i, i + 1);
            System.out.println("检查："+substring);
            if(!Pattern.matches(".*[~`!@#$%^&*()_+-=\\[\\]{}|\\\\;:'\",.<>?/].*",substring)){
                System.out.println("----------------不包含:"+substring);
            }
        }

        System.out.println(b);
    }


    private static void mapToString(){
        Map<String,Object> map = new HashMap<>();
        map.put("case-sensitivity",false);
        map.put("contains-number",false);
        map.put("contains-special-symbols",false);
        map.put("length-limit",false);
        map.put("max-length",20);
        map.put("min-length",6);
        System.out.println(map);
       ObjectMapper objectMapper = new ObjectMapper();
        String s = null;
        try {
            s = objectMapper.writeValueAsString(map);
            System.out.println(s);
            Map map1 = objectMapper.readValue(s, Map.class);
            System.out.println(map1);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }

    }


    private static void testList(){
        Set<String> appList = new HashSet<>();
        appList.add("aa");
        appList.add("bb");
        appList.add("cc");
        appList.add("dd");
        ArrayList<String> list = Lists.newArrayList(appList);
        System.out.println(list);
    }

    private static void testDeduplication(){
        List<String> appList = new ArrayList<>();
        appList.add("aa");
        appList.add("bb");
        appList.add("cc");
        appList.add("dd");
        appList.add("dd");
        appList.add("aa");
        System.out.println("before size:"+appList.size());
        Iterator<String> iterator = appList.iterator();
        Set<String> valueSet =new HashSet<>();
        while (iterator.hasNext()){
            String next = iterator.next();
            if(valueSet.contains(next)){
                iterator.remove();
                continue;
            }
            valueSet.add(next);
        }
        System.out.println("after size:"+appList.size());
    }

    private static void test1(){
        Set<Long> frontIds = new HashSet<>();
        frontIds.add(null);
        frontIds.add(1L);
        System.out.println("size:"+frontIds.size());
//      String aa ="IN_resourceId";
//        System.out.println(aa.substring(3,aa.length()));
//        System.out.println(aa.substring(3));
    }

    private static void test2(){
        Integer aa = 22;
        long aLong = Long.parseLong(aa.toString());
        System.out.println(aLong);
        Integer bb =null;
        long aong = Long.parseLong(bb.toString());
    }

    private static void tt(){
        boolean hasCondition =false;
        String aaa = "MEMBER";
        switch (aaa) {
            case "INSTITUTION":
                hasCondition = true;
                break;
            case "DEPARTMENT":
                //部门默认包含下级部门
                hasCondition = true;
                break;
            case "MEMBER":
                break;
            case "OUTSIDE_MEMBER":
                hasCondition = true;
                break;
            case "TEAM":
                hasCondition = true;
                break;
            case "POST":
                hasCondition = true;
                break;
            case "JOB":
                hasCondition = true;
                break;
            case "LEVEL":
                hasCondition = true;
                break;
            case "ENUM":
                break;
            case "OUTSIDE_INSTITUTION":
                hasCondition = true;
                break;
            case "OUTSIDE_DEPARTMENT":
                hasCondition = true;
                break;
            default:
                break;
        }
        System.out.println(hasCondition);
    }
}
